<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0& ak=9LVtztl4kxzEXtCCqb2824GOp0rSdmSC"></script>
<title>党建地图</title>
<style type="text/css">
	body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微软雅黑";}
</style>
<link rel="stylesheet" href="../layui/css/layui.css" th:href="@{../layui/css/layui.css}">

</head>

<body>
<p id="allmap"></p>
<script th:src="@{../layui/layui.js}"></script>
<script type="text/javascript" th:inline="javascript">
	var map = new BMap.Map("allmap");
	map.centerAndZoom(new BMap.Point(113.933349,35.308973), 11);  // 设置中心点
	map.centerAndZoom("新乡");//设置为新乡
	map.setCurrentCity("新乡");          
	map.addControl(new BMap.MapTypeControl());   
	map.enableScrollWheelZoom(true); 
	var list=[[${coordinates}]];
	//alert(list)
	for(var i=0;i<list.length;i++){
	   //创建小狐狸图标
	 var index=list[i];
	// alert(index);
	 if(index!=null){
	 //var pt = new BMap.Point(113.933349,35.308973);
	 var x = index.split(",")[0];
	 var y = index.split(",")[1];
	 var pt = new BMap.Point(x,y);
	 var myIcon = new BMap.Icon("http://lbsyun.baidu.com/jsdemo/img/fox.gif", new BMap.Size(300,157));
	 var marker2 = new BMap.Marker(pt,{icon:myIcon});  // 创建标注
	 map.addOverlay(marker2);
	 }
	}
	 
</script>

</body>
</html>
